//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.graphite.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.reflect.Field;

/**
 * 反射工具类
 */
public class InvokeUtil {
    private static Logger logger = LoggerFactory.getLogger(InvokeUtil.class);

    public InvokeUtil() {
    }

    public static Object getFieldValueByName(Field field, Object obj) {
        try {
            field.setAccessible(true);
            Object value = field.get(obj);
            return value;
        } catch (IllegalArgumentException var3) {
            logger.error("IllegalArgumentException:", var3);
        } catch (IllegalAccessException var4) {
            logger.error("IllegalAccessException:", var4);
        }

        return null;
    }

    public static void setFieldValueByName(Field field, Object obj, String uuid) {
        try {
            field.setAccessible(true);
            field.set(obj, uuid);
        } catch (IllegalArgumentException var4) {
            logger.error("IllegalArgumentException:", var4);
        } catch (IllegalAccessException var5) {
            logger.error("IllegalAccessException:", var5);
        }

    }

    public static Field[] getFields(Object o) {
        return o.getClass().getDeclaredFields();
    }
}
